package lab02.test34;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by V555 on 2017/11/18.
 */
public class Test {
    public static void main(String[] args) {
        List<String>words=new ArrayList<>();
        //apple, grape, banana, pear
        words.add("apple");
        words.add("grape");
        words.add("banana");
        words.add("pear");

        Object[] word=words.toArray();
        //1)	返回集合中的最大的和最小的元素
        System.out.println("最大的元素："+word[0]);
        System.out.println("最小的元素："+word[word.length-1]);
        //2)	将集合进行排序，并将排序后的结果打印在控制台上
        System.out.println("排序后：");
        for (Object m:word){
            System.out.println(m);

        }

    }
}
